﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="CurrentReviewMenu.aspx.cs" Inherits="CodeDemon.Views.Review.CurrentReviewMenu" %>
<% 

    var r = from reviews in ViewData.Model.DAO.Reviews
            join status in ViewData.Model.DAO.ReviewStatus on reviews.ReviewStatusID equals status.ReviewStatusID
            join parts in ViewData.Model.DAO.ReviewParticipants on reviews.ReviewID equals parts.ReviewID
            join partStatus in ViewData.Model.DAO.ReviewStatus on parts.ReviewStatusID equals partStatus.ReviewStatusID
            where reviews.ReviewStatusID == 1
			&& parts.ReviewUserID == ViewData.Model.CurrentReviewUserID
            && parts.ParticipantIsReviewer == true
            && partStatus.IsFinishedStatus == false
            orderby reviews.ReviewCreatedTimeStamp descending
            select new
            {
                reviews.ReviewID,
                reviews.Title,
                reviews.Description,
                status.StatusName,
                reviews.ReviewCreatedTimeStamp,
                reviews.DefectNumber
            };
    
   foreach(var review in r ) {
       string title = String.Empty;
       if (review.Title.Length > 27) {
           title = review.Title.Remove( 26 ) + "...";
       } else {
           title = review.Title;
       }
       
    %>
    
     
                        <li><%= Html.ActionLink( title, "DisplayReview", "Review", new { reviewId = review.ReviewID }, null )%> </li>
    
<%    
       }

    %>
